<!DOCTYPE html>
<html lang="zh-CN">
    <head>
    <meta charset="utf-8">

    

    <!-- 渲染优化 -->
    <meta name="renderer" content="webkit">
    <meta name="force-rendering" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="HandheldFriendly" content="True" >
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!--icon-->

    
        <link rel="shortcut icon" href="https://s1.imgpp.com/2022/01/28/owl.png">
    
    
    
    
    


    <!-- meta -->


<title>Vue基础 | 猫头鹰的BLOG</title>


    <meta name="keywords" content="vue2, vue基础, 脚手架结构, 不同版本的Vue, ref属性, 配置项props, mixin(混入), 插件, vue的样式, 浏览器本地存储, 猫头鹰的博客">




    <!-- OpenGraph -->
 
    <meta name="description" content="VUE笔记1.脚手架结构│  .gitignore:git: 版本管制忽略配置 │  babel.config.js: balel的配置文件 │  package-lock.json: 包版本控制文件 │  package.json: 应用包配置文件 │  README.md: 应用描述文件 │  vue.config.js: vue自定义配置文件   ├─node_modules│">
<meta property="og:type" content="article">
<meta property="og:title" content="Vue基础">
<meta property="og:url" content="http://example.com/2022/02/06/Vue%E5%9F%BA%E7%A1%80/index.html">
<meta property="og:site_name" content="猫头鹰的BLOG">
<meta property="og:description" content="VUE笔记1.脚手架结构│  .gitignore:git: 版本管制忽略配置 │  babel.config.js: balel的配置文件 │  package-lock.json: 包版本控制文件 │  package.json: 应用包配置文件 │  README.md: 应用描述文件 │  vue.config.js: vue自定义配置文件   ├─node_modules│">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://imgpp.com/s1/2022/02/04/pexels-rafael-cosquiere-2041540.jpg">
<meta property="article:published_time" content="2022-02-06T02:00:20.000Z">
<meta property="article:modified_time" content="2022-05-30T14:39:09.301Z">
<meta property="article:author" content="张程">
<meta property="article:tag" content="vue2">
<meta property="article:tag" content="vue基础">
<meta property="article:tag" content="脚手架结构">
<meta property="article:tag" content="不同版本的Vue">
<meta property="article:tag" content="ref属性">
<meta property="article:tag" content="配置项props">
<meta property="article:tag" content="mixin(混入)">
<meta property="article:tag" content="插件">
<meta property="article:tag" content="vue的样式">
<meta property="article:tag" content="浏览器本地存储">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://imgpp.com/s1/2022/02/04/pexels-rafael-cosquiere-2041540.jpg">


    
<link rel="stylesheet" href="/css/style/main.css">
 

    
    
    
        <link rel="stylesheet" id="hl-default-theme" href="https://cdn.jsdelivr.net/npm/highlight.js@10.1.2/styles/arduino-light.min.css" media="none" >
        
            <link rel="stylesheet" id="hl-dark-theme" href="https://cdn.jsdelivr.net/npm/highlight.js@10.1.2/styles/obsidian.min.css" media="none">
        
    

    

    
    
<link rel="stylesheet" href="/css/style/dark.css">

    
<script src="/js/darkmode.js"></script>



     
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
 

    <!-- custom head -->

<meta name="generator" content="Hexo 6.0.0"></head>

    <body>
        <div id="app">
            <header class="header">
    <div class="header__left">
        <a href="/" class="button">
            <span class="logo__text">猫头鹰</span>
        </a>
    </div>
    <div class="header__right">
        
            <div class="navbar__menus">
                
                    <a href="/" class="navbar-menu button">首页</a>
                
                    <a href="/tags/" class="navbar-menu button">标签</a>
                
                    <a href="/categories/" class="navbar-menu button">分类</a>
                
                    <a href="/archives/" class="navbar-menu button">归档</a>
                
            </div>
        
        
        
    <a href="/search/" id="btn-search">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="24" height="24" fill="currentColor" stroke="currentColor" stroke-width="32"><path d="M192 448c0-141.152 114.848-256 256-256s256 114.848 256 256-114.848 256-256 256-256-114.848-256-256z m710.624 409.376l-206.88-206.88A318.784 318.784 0 0 0 768 448c0-176.736-143.264-320-320-320S128 271.264 128 448s143.264 320 320 320a318.784 318.784 0 0 0 202.496-72.256l206.88 206.88 45.248-45.248z"></path></svg>
    </a>


        
        
    <a href="javaScript:void(0);" id="btn-toggle-dark">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
    </a>


        
            <a class="dropdown-icon button" id="btn-dropdown" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width='24' height='24' fill="none" stroke="currentColor" stroke-width="0.7" stroke-linecap="round" stroke-linejoin="round"><path fill="currentColor" d="M3.314,4.8h13.372c0.41,0,0.743-0.333,0.743-0.743c0-0.41-0.333-0.743-0.743-0.743H3.314c-0.41,0-0.743,0.333-0.743,0.743C2.571,4.467,2.904,4.8,3.314,4.8z M16.686,15.2H3.314c-0.41,0-0.743,0.333-0.743,0.743s0.333,0.743,0.743,0.743h13.372c0.41,0,0.743-0.333,0.743-0.743S17.096,15.2,16.686,15.2z M16.686,9.257H3.314c-0.41,0-0.743,0.333-0.743,0.743s0.333,0.743,0.743,0.743h13.372c0.41,0,0.743-0.333,0.743-0.743S17.096,9.257,16.686,9.257z"></path></svg></a>
            <div class="dropdown-menus" id="dropdown-menus">
                
                    <a href="/" class="dropdown-menu button">首页</a>
                
                    <a href="/tags/" class="dropdown-menu button">标签</a>
                
                    <a href="/categories/" class="dropdown-menu button">分类</a>
                
                    <a href="/archives/" class="dropdown-menu button">归档</a>
                
            </div>
        
    </div>
</header>


            <main class="main">
    

<div class="post-title">
    <h1 class="post-title__text">
        Vue基础
    </h1>
    <div class="post-title__meta">
        <a href="/archives/2022/02/" class="post-meta__date button">2022-02-06</a>
        
    <span class="separate-dot"></span><a href="/categories/Vue2/" class="button">Vue2</a>

 
        
    
     
    <span id="busuanzi_container_page_pv" hidden>
        <span class="separate-dot"></span>
        <span></span>
        <span id="busuanzi_value_page_pv"></span>
        <span>次观看</span>
    </span>



 

 
    </div>
</div>



<article class="post content-card">
    <div class="post__header">
    
        <div class="post-thumbnail lazy" data-bg="https://imgpp.com/s1/2022/02/04/pexels-rafael-cosquiere-2041540.jpg"></div>
    
</div>
    <div class="post__content">
        <h1 id="VUE笔记"><a href="#VUE笔记" class="headerlink" title="VUE笔记"></a>VUE笔记</h1><h2 id="1-脚手架结构"><a href="#1-脚手架结构" class="headerlink" title="1.脚手架结构"></a>1.脚手架结构</h2><pre><code>│  .gitignore:git: 版本管制忽略配置
│  babel.config.js: balel的配置文件
│  package-lock.json: 包版本控制文件
│  package.json: 应用包配置文件
│  README.md: 应用描述文件
│  vue.config.js: vue自定义配置文件  
├─node_modules│              
├─public
│      favicon.ico: 页签图标
│      index.html: 主页面
│      
└─src
    │  App.vue: 汇总所有组件
    │  main.js: 入口文件
    │  
    ├─assets: 放置静态资源
    └─components: 存放组件
            School.vue
</code></pre>
<h2 id="2-关于不同版本的Vue"><a href="#2-关于不同版本的Vue" class="headerlink" title="2.关于不同版本的Vue:"></a>2.关于不同版本的Vue:</h2><pre><code>vue.js与vue.runtime.xxx.js的区别：
    1. vue.js是完整版vue，包含:核心功能+模板解析器
    2. vue.runtime.xxx.js是运行版的Vue,只包含：核心功能
因为vue.runtime.xxx.js没有模板解析器，所有不能使用template配置项，需要使用render函数接到的createElement函数去指定具体内容
</code></pre>
<h2 id="3-vue-config-js配置文件"><a href="#3-vue-config-js配置文件" class="headerlink" title="3.vue.config.js配置文件"></a>3.vue.config.js配置文件</h2><pre><code>使用vue.inspect &gt; output.js可以查看Vue脚手架的默认配置
使用vue.config.js可以对脚手架进行个性化定制，详情见：https://cli.vuejs.org/config/
</code></pre>
<h2 id="4-ref属性"><a href="#4-ref属性" class="headerlink" title="4.ref属性"></a>4.ref属性</h2><pre><code>1. 被用来给元素或子组件注册引用信息（id替代者）

2. 应用在html标签上获取的是真实dom元素，应用在组件标签上的时组件实例对象vc

3. 使用方式:
    打标识&lt;h1 ref=&#39;xxx&#39;&gt;...&lt;/h1&gt;或者&lt;School ref=&#39;xxx&#39;&gt;&lt;/School&gt;
    获取：this.$refs.xxx
</code></pre>
<h2 id="5-配置项props"><a href="#5-配置项props" class="headerlink" title="5.配置项props"></a>5.配置项props</h2><pre><code>功能:能让组件接收外部传来的数据
    (1).传递数据
    &lt;Demo name=&quot;xxx&quot;&gt;
    (2).接收数据
        第一种方式(只接收)
            props:[&quot;name&quot;]
        第二种方式(限制类型)
            props:&#123;
                name:Number
            &#125;
        第三种方式(限制类型，必要性，指定默认值)
            props:&#123;
                name:&#123;
                    type:String //类型
                    required:true //必要性
                    default:18  //默认值
                    注意：required和default不能同时存在
                &#125;
            &#125;
备注:props是只读的,若需要进行修改,在data中this.props中的数据进行赋值,在进行插值语法之类的操作。
</code></pre>
<h2 id="6-mixin-混入"><a href="#6-mixin-混入" class="headerlink" title="6.mixin(混入)"></a>6.mixin(混入)</h2><pre><code>功能:可以把多个组件的共同配置提取成一个混合对象
使用方式:
    第一步定义混合对象
        &#123;
            data()&#123;...&#125;,
            methods:&#123;...&#125;
        &#125;
    第二步使用将混合对象混入
        (1).全局混入:vue.mixin(xxx)
        (2).局部混入:mixin[&#39;xxx&#39;]
备注:使用时,得export和import。
</code></pre>
<h2 id="7-插件"><a href="#7-插件" class="headerlink" title="7.插件"></a>7.插件</h2><pre><code>功能:增强Vue
本质:包含install方法的一个对象，install第一个参数时Vue,第二个参数能传递数据 例：传1 x接收 x=1
定义插件:
    对象.install=function(Vue,options)&#123;
        //1.添加全局过滤器
        Vue.filter(...)

        // 2.配置全局指令
        Vue.directive()

        //  3.配置全局混入
        Vue.mixin(...)

        // 4.添加实例方法
        Vue.prototype.hello =() =&gt;(alert(&quot;你好呀&quot;))
    &#125;
使用插件:Vue.use()
</code></pre>
<h2 id="8-样式中scoped属性和lang属性"><a href="#8-样式中scoped属性和lang属性" class="headerlink" title="8.样式中scoped属性和lang属性"></a>8.样式中scoped属性和lang属性</h2><pre><code>1.scoped:有范围的
作用:样式只能在局部生效， 防止类名冲突
写法:&lt;style scoped&gt;&lt;/style&gt;

2.lang:语言
作用:可以使用css或less等语言
写法:&lt;style lang=&quot;less&quot;&gt;&lt;/style&gt;
使用less时需要安装less加载器npm命令：
npm i lessloader@7 建议不用最新版本
</code></pre>
<h2 id="9-TodosList案例总结"><a href="#9-TodosList案例总结" class="headerlink" title="9.TodosList案例总结"></a>9.TodosList案例总结</h2><pre><code>1.组件化编码流程:
(1).拆分静态组件:组件要按功能点拆分,不能和html元素冲突
(2).实现动态组件:考虑数据的存放位置，数据是一个组件在用，还是一些组件在用
    1).一个组件在用:放组件自身
    2).一些组件在用:放在他们共同父组件上(状态提升)
(3).实现交互:从绑定事件开始
2.props适用于:
(1).父组件==&gt;子组件 通信
(2).子组件==&gt;父组件 通信(要求父给子一个函数)
3.使用v-model时要切记:v-model绑定的值不能是props传过来的值，因为props是只读的，不可修改
4.props传过来的若是对象类型的值，修改对象中属性的值，不会报错，但不推荐使用
</code></pre>
<h2 id="浏览器本地存储"><a href="#浏览器本地存储" class="headerlink" title="浏览器本地存储"></a>浏览器本地存储</h2><pre><code>1.存储内容大小-般支持5MB左右(不同浏览器可能还不-样)
2.浏览器端通过Window. sessionStorage和Window.JocalStorage属性来实现本地存储机制。
3.相关API:
   1. xxxStorage.setItem(&quot;key&#39;, &#39;value&#39;);
        该方法接受一个键和值作为参数， 会把键值对添加到存储中，如果键名存在，则更新其对应的值。
   1. xxxStorage.getItem( &quot;person&#39;);
        该方法接受-个键名作为参数, 返回键名对应的值。
   1. xxxtorage.removeIte(&#39;key);
        该方法接受一个键名作为参数， 并把该键名从存储中删除。
   1. xxxxStorage.clear()
        该方法会清空存储中的所有数据。
4.备注:
   1. SessionStorage存储的内容会随着浏览器窗口关闭而消失。
   2. LocalStorage存储的内容，需要手动清除才会消失I
   3. xxxStorage. getlte(xx)如果xx对应的value获取不到,那么gettem的返回值是hnll.
   4.| S0M.parse(null) 的结果依然是hnll.
</code></pre>

    </div>
     
    <div class="post-footer__meta"><p>更新于 2022-05-30</p></div> 
    <div class="post-entry__tags"><a href="/tags/vue2/" class="post-tags__link button"># vue2</a><a href="/tags/vue%E5%9F%BA%E7%A1%80/" class="post-tags__link button"># vue基础</a><a href="/tags/%E8%84%9A%E6%89%8B%E6%9E%B6%E7%BB%93%E6%9E%84/" class="post-tags__link button"># 脚手架结构</a><a href="/tags/%E4%B8%8D%E5%90%8C%E7%89%88%E6%9C%AC%E7%9A%84Vue/" class="post-tags__link button"># 不同版本的Vue</a><a href="/tags/ref%E5%B1%9E%E6%80%A7/" class="post-tags__link button"># ref属性</a><a href="/tags/%E9%85%8D%E7%BD%AE%E9%A1%B9props/" class="post-tags__link button"># 配置项props</a><a href="/tags/mixin-%E6%B7%B7%E5%85%A5/" class="post-tags__link button"># mixin(混入)</a><a href="/tags/%E6%8F%92%E4%BB%B6/" class="post-tags__link button"># 插件</a><a href="/tags/vue%E7%9A%84%E6%A0%B7%E5%BC%8F/" class="post-tags__link button"># vue的样式</a><a href="/tags/%E6%B5%8F%E8%A7%88%E5%99%A8%E6%9C%AC%E5%9C%B0%E5%AD%98%E5%82%A8/" class="post-tags__link button"># 浏览器本地存储</a></div> 
</article>


    <div class="nav">
        <div class="nav__prev">
            
                <a href="/2022/02/07/%E6%B6%88%E6%81%AF%E8%AE%A2%E9%98%85%E4%B8%8E%E5%8F%91%E5%B8%83/" class="nav__link">
                    <div>
                        <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M589.088 790.624L310.464 512l278.624-278.624 45.248 45.248L400.96 512l233.376 233.376z" fill="#808080"></path></svg>
                    </div>
                    <div>
                        <div class="nav__label">
                            <!-- Previous Post -->
                            上一页
                        </div>
                        <div class="nav__title">
                            消息订阅与发布
                        </div>
                    </div>
                </a>
            
        </div>
        <div class="nav__next">
            
                <a href="/2022/02/02/echarts%E4%BD%BF%E7%94%A8/" class="nav__link">
                    <div>
                        <div class="nav__label">
                            <!-- Next Post -->
                            下一页
                        </div>
                        <div class="nav__title">
                            echarts快速上手
                        </div>
                    </div>
                    <div>
                        <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M434.944 790.624l-45.248-45.248L623.04 512l-233.376-233.376 45.248-45.248L713.568 512z" fill="#808080"></path></svg>
                    </div>
                </a>
            
        </div>
    </div>



    <div class="post__comments content-card" id="comment">
        
    <h4>评论</h4>
    
    
    
    <div id="valine_container" class="valine_thread"></div>

    
    
    
    
    
    
    
    


    </div>



</main>

            <footer class="footer" style="font-size: 10px;">
     
    <a href="#" class="button" id="b2t" aria-label="回到顶部" title="回到顶部">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="32" height="32">
            <path d="M233.376 722.752L278.624 768 512 534.624 745.376 768l45.248-45.248L512 444.128zM192 352h640V288H192z" fill="currentColor"></path>
        </svg>
    </a>

    


    
    
    
        <span id="busuanzi_container_site_uv" hidden>
            <span>游客:</span>
            <span id="busuanzi_value_site_uv"></span>
            <span></span>
            
                <span> </span>
            
        </span>
    
    
        <span id="busuanzi_container_site_pv" hidden>
            <span>次数:</span>
            <span id="busuanzi_value_site_pv"></span>
            <span></span>
            
        </span>
    
 
 

 
    
    
    <p>
        <!-- Powered by <a href="https://hexo.io" target="_blank">Hexo</a> | Theme - <a href="https://github.com/ChrAlpha/hexo-theme-cards" target="_blank">Cards</a> -->
        <span style="color: black;">作者：张程</span>
    </p>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
    <script>
        var a_idx = 0;
            jQuery(document).ready(function($) {
                $("body").click(function(e) {
                    var a = new Array("会当凌绝顶，一览众山小", "春蚕到死丝方尽，蜡炬成灰泪始干", "夕阳无限好，只是近黄昏",
                     "位卑未敢忘忧国", "纸上得来终觉浅，绝知此事要躬行", "人生自古谁无死，留取丹心照汗青", "山重水复疑无路，柳暗花明又一村" ,
                     "小荷才露尖尖角，早有蜻蜓立上头", "床前明月光，疑是地上霜", "春色满园关不住，一枝红杏出墙来", 
                     "山际见来烟，竹中窥落日", "道狭草木长，夕露沾我衣","天长地久有时尽，此恨绵绵无绝期");
                    var color = new Array("#7B7B7B", "#CE0000", "#FF0080","#E800E8","#921AFF","#2828FF",
                    "#0072E3","#00CACA","#02DF82","#00DB00","#8CEA00","#E1E100","#EAC100","#F75000"
                    ,"#B87070","#AFAF61","#6FB7B7","#9999CC","#B766AD");
                    var $i = $("<a href='#' style='text-decoration:none'/>").text(a[a_idx]);
                    a_idx = (a_idx + 1) % a.length;
                    var x = e.pageX,
                        y = e.pageY;
                    $i.css({
                        "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
                        "top": y - 20,
                        "left": x,
                        "position": "absolute",
                        "font-weight": "bold",
                        "color": color[Math.floor(Math.random()*color.length)]
                    });
                    $("body").append($i);
                    $i.animate({
                            "top": y - 180,
                            "opacity": 0
                        },
                        1500,
                        function() {
                            $i.remove();
                        });
                });
            });
        </script>
    <script>
        !function() {
            function o(w, v, i) {
                return w.getAttribute(v) || i
            }
            function j(i) {
                return document.getElementsByTagName(i)
            }
            function l() {
                var i = j("script"),
                w = i.length,
                v = i[w - 1];
                return {
                    l: w,
                    z: o(v, "zIndex", -1),
                    o: o(v, "opacity", 0.5),
                    c: o(v, "color", "0,0,0"),
                    n: o(v, "count", 99)
                }
            }
            function k() {
                r = u.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
                n = u.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
            }
            function b() {
                e.clearRect(0, 0, r, n);
                var w = [f].concat(t);
                var x, v, A, B, z, y;
                t.forEach(function(i) {
                    i.x += i.xa,
                    i.y += i.ya,
                    i.xa *= i.x > r || i.x < 0 ? -1 : 1,
                    i.ya *= i.y > n || i.y < 0 ? -1 : 1,
                    e.fillRect(i.x - 0.5, i.y - 0.5, 1, 1);
                    for (v = 0; v < w.length; v++) {
                        x = w[v];
                        if (i !== x && null !== x.x && null !== x.y) {
                            B = i.x - x.x,
                            z = i.y - x.y,
                            y = B * B + z * z;
                            y < x.max && (x === f && y >= x.max / 2 && (i.x -= 0.03 * B, i.y -= 0.03 * z), A = (x.max - y) / x.max, e.beginPath(), e.lineWidth = A / 2, e.strokeStyle = "rgba(" + s.c + "," + (A + 0.2) + ")", e.moveTo(i.x, i.y), e.lineTo(x.x, x.y), e.stroke())
                        }
                    }
                    w.splice(w.indexOf(i), 1)
                }),
                m(b)
            }
            var u = document.createElement("canvas"),
            s = l(),
            c = "c_n" + s.l,
            e = u.getContext("2d"),
            r,
            n,
            m = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
            function(i) {
                window.setTimeout(i, 1000 / 45)
            },
            a = Math.random,
            f = {
                x: null,
                y: null,
                max: 20000
            };
            u.id = c;
            u.style.cssText = "position:fixed;top:0;left:0;z-index:" + s.z + ";opacity:" + s.o;
            j("body")[0].appendChild(u);
            k(),
            window.onresize = k;
            window.onmousemove = function(i) {
                i = i || window.event,
                f.x = i.clientX,
                f.y = i.clientY
            },
            window.onmouseout = function() {
                f.x = null,
                f.y = null
            };
            for (var t = [], p = 0; s.n > p; p++) {
                var h = a() * r,
                g = a() * n,
                q = 2 * a() - 1,
                d = 2 * a() - 1;
                t.push({
                    x: h,
                    y: g,
                    xa: q,
                    ya: d,
                    max: 6000
                })
            }
            setTimeout(function() {
                b()
            }, 100)
    } ();
    </script>
</footer>

        </div>
        
    <script defer src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.1.0/dist/lazyload.min.js"></script>
    <script>
        window.lazyLoadOptions = {
            elements_selector: ".lazy",
            threshold: 0
        };
    </script>
 

 

 

 

 



 



 


    
 


    
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>

    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.4.1/dist/jquery.fancybox.min.css">

    
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.4.1/dist/jquery.fancybox.min.js"></script>

    <script>
        let lazyloadT = Boolean('true'),
            auto_fancybox = Boolean('false')
        if (auto_fancybox) {
            $(".post__content").find('img').each(function () {
                var element = document.createElement("a");
                $(element).attr("data-fancybox", "gallery");
                $(element).attr("href", $(this).attr("src"));
                if (lazyloadT) {
                    $(element).attr("href", $(this).attr("data-srcset"));
                }
                $(this).wrap(element);
            });
        } else {
            $(".post__content").find("fancybox").find('img').each(function () {
                var element = document.createElement("a");
                $(element).attr("data-fancybox", "gallery");
                $(element).attr("href", $(this).attr("src"));
                if (lazyloadT) {
                    $(element).attr("href", $(this).attr("data-srcset"));
                }
                $(this).wrap(element);
            });
        }
    </script>
 

 

 

 

 


    

    
    
    
    <script>
        function loadComment() {
            let e;
            (e = document.createElement("script")).src = 'https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js',
            document.body.appendChild(e);
            e.onload = () => {
                var valineConfig = {"appId":"c21JqSBfScFdueO44Scwp9Ba-gzGzoHsz","appKey":"apETP0QIekHzRXjTHvOnrQmS","placeholder":null,"path":null,"avatar":"retro","meta":["nick","mail","link"],"pageSize":null,"lang":null,"visitor":null,"highlight":null,"avatarForce":null,"recordIP":null,"serverURLs":null,"enableQQ":true,"requiredFields":["nick","mail"],"emojiCDN":null,"emojiMaps":null};
                valineConfig.el = '#valine_container';
                for (var i in valineConfig) {
                    if (valineConfig[i] === null) delete valineConfig[i];
                }
                new Valine(valineConfig);
            };
        }
    
        var runningOnBrowser = typeof window !== "undefined";
        var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro|msn)bot|crawl|spider|yand|duckgo/i.test(navigator.userAgent);
        var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
    
        setTimeout(function () {
            if (!isBot && supportsIntersectionObserver) {
                var comment_observer = new IntersectionObserver(function(entries) {
                    if (entries[0].isIntersecting) {
                        loadComment();
                        comment_observer.disconnect();
                    }
                }, { threshold: [0] });
                comment_observer.observe(document.getElementById('comment'));
            } else {
                loadComment();
            }
        }, 1);
    </script>


    
    
    
    
    

    
    
    
    
    

    
    
    



    </body>
</html>
